import React, { useEffect, useState } from 'react'
import { connect } from 'react-redux';
import { push } from 'react-router-redux';
import './style.less'
import { FullScreenContainer } from '$components'

function homePage(props) {
    const { dispatch } = props;
    const childStyle = { height: '32%', color: '#fff', marginBottom: 17 }
    const cardHeight = document.body.clientHeight * 0.896 * 0.32
    const cardContentHeight = cardHeight - 42 - 13

    return <div className='enter_container'>
        <FullScreenContainer>
            <div className='enter_homepage'>
                <div className='_enter_title'></div>
                <div className='_enter_row1'>
                    <div className='_row1_item' onClick={() => { window.open('https://smartcitychangnan.anxinyun.cn') }}></div>
                    <div className='_row2_item' onClick={() => { window.open('https://govdata.anxinyun.cn/signin') }}></div>
                </div>
                <div className='_enter_row2'>
                    <div className='_row2_item1' onClick={() => {
                        dispatch(push('/waterprevention'))
                    }}></div>
                    <div className='_row2_item2' onClick={() => { dispatch(push('/communitysafty')) }}></div>
                    <div className='_row2_item3' onClick={() => { dispatch(push('/firecontrol')) }}></div>
                </div>
            </div>
        </FullScreenContainer>
    </div>

}

function mapStateToProps(state) {
    const {
        auth, global
    } = state;
    return {
        clientHeight: global.clientHeight,
        actions: global.actions,

    };
}

export default connect(mapStateToProps)(homePage);


